<?php
namespace app\index\controller;

use app\index\model\Logins;

use think\Controller;
class Login extends Controller
{
    public function loginindex()
    {
        if(null!==input('submit'))
        {
            $account = input('admin');
            $root    = input('password');
            $yzmtp   = input('yzm');
            if($yzmtp=='true')
            {
                $login = new Logins;
                $db = $login->checkLogin($account,$root);
            
                if($db==1)
                {

                    $this->redirect('index/index');
                }
                else{
                    $this->error('登录失败');
                }
            }
        }
        return view('login');
    }
}